package main

import "fmt"

type item string
type character struct {
	name     string
	leftHand *item
}

func (c *character) pickup(i *item) {
	c.leftHand = i
}

func (c *character) give(to *character) {
	to.leftHand = c.leftHand
	c.leftHand = nil
}

func main() {
	i := item("book")
	Arthur := character{
		name:     "Arthur",
		leftHand: nil,
	}
	knight := character{
		name:     "knight",
		leftHand: nil,
	}

	fmt.Println(Arthur.leftHand, knight.leftHand)
	Arthur.pickup(&i)
	fmt.Println(*Arthur.leftHand, knight.leftHand)
	Arthur.give(&knight)
	fmt.Println(Arthur.leftHand, *knight.leftHand)

}
